/**
 * Created by Administrator on 2017/7/13.
 */
$(function(){
    var totalCounts = 1000;
    var pageSize = 20;
    var visiblePages = 5;
    var currentPage = 1;
    /* var totalPages = totalCounts%pageSize==0?(totalCounts/pageSize):(totalCounts/pageSize+1); */
    var totalPages = Math.ceil(totalCounts/pageSize);
    $('#page_plus').jqPaginator({

        totalCounts: totalCounts,
        pageSize:pageSize,
        visiblePages: visiblePages,
        currentPage: currentPage,

        first:'<li class="first"><a href="javascript:void(0);">首页</a></li>',
        prev: '<li class="prev"><a href="javascript:void(0);">上一页</a></li>',
        next: '<li class="next"><a href="javascript:void(0);">下一页</a></li>',
        last: '<li class="last"><a href="javascript:void(0);">末页</a></li>',
        page: '<li class="page"><a href="javascript:void(0);">{{page}}</a></li>',
        onPageChange: function (num,type) {

            if(type !='init'){
                alert(type+'当前第' + num + '页');
            }
            $("#totalPage").html(totalCounts);
            $("#currentPage").html(num+"/"+totalPages);
        }
    });

})